<?php
    $id  = $_GET['sessionId'];
    $id = trim($id);

    session_name($id);
    session_start();
    $inputName = $_GET['userfile'];
    $fileName  = $_FILES[$inputName]['name'];
    $tempLoc   = $_FILES[$inputName]['tmp_name'];
    echo $_FILES[$inputName]['error'];
	$vinCode ="1234567890qw";
	$uploaddir = dirname($_SERVER['SCRIPT_FILENAME'])."/uploads/Upload-Vehicles";
	$uploaddir = $uploaddir."/".$vinCode."/";
	mkdir($uploaddir);
	$uploaddir1 = $uploaddir."org/";
	mkdir($uploaddir1);
	
    $target_path = $uploaddir1 . basename($fileName);
    
    $orgImgPath = $vinCode."/org/".basename($fileName);
	$res = clsEssential::SavingUploadingImages($vinCode,$orgImgPath);
	
    if(move_uploaded_file($tempLoc,$target_path))
    {        $_SESSION['value'] = -1;    }
?>
